package com.dq.repository.record;

import com.dq.domain.record.RoyaltyRecord;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

/**
 * @Author luchangtong
 * @Date 2019/12/2 16:57
 */
@Repository
public interface RoyaltyRecordRepository extends JpaRepository<RoyaltyRecord,Long> {
    @Query("select COALESCE(sum(royaltyPrice),0) from RoyaltyRecord where sysUser = ?1")
    BigDecimal getSumPrice(SysUser sysUser);
}
